<!--
*
*  INSPINIA - Responsive Admin Theme
*  version 2.7
*
-->

<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title><?=$system['sys_title']?> | <?=$title?></title>
    <?php $this->load->view('template/css');?>
    <link rel="stylesheet" href="<?=base_url("assets/css/my.css")?>">
    <link rel="stylesheet" href="<?=base_url("assets/css/plugins/iCheck/custom.css")?>">
    <link href="<?=base_url("assets/css/plugins/dataTables/datatables.min.css")?>" rel="stylesheet">
</head>

<body class="font16">
<?php $this->load->view('template/header');?>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5 style="font-size: 18px;"><?=$title?></h5>

                </div>
                <div class="ibox-content">
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th>openid</th>
                            <th>昵称</th>
                            <th>性别</th>
                            <th>城市</th>
                            <th>头像</th>
                            <th>累计投入（元）</th>
                            <th>累计赚取（元）</th>
                            <th>参与次数</th>
                            <th>连续打卡</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach($user as $v):?>
                        <tr>
                            <td><?=$v['openid']?></td>
                            <td><?=$v['nickName']?></td>
                            <td><?=$enum_show['age'][$v['gender']]?></td>
                            <td><?=$v['province'].$v['city']?></td>
                            <td><img height="50px" src="<?=$v['avatarUrl']?>" alt=""></td>
                            <td><?=$v['inputMoney']?></td>
                            <td><?=$v['earnMoney']?></td>
                            <td><?=$v['signNum']?></td>
                            <td><?=$v['siteNum']?></td>
                            <td >
<!--                                <a href="javascript:;" class="btn badge badge-info font15 attr-edit " attr-id="--><?//=$v['usr_id']?><!--">编辑</a>-->
                                <a href="javascript:;" class="btn badge badge-danger font15 attr-del" attr-message="<?=$v['nickName']?>" attr-id="<?=$v['openid']?>" >删除</a>
                            </td>
                        </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    </div>
</div>

<script>
    var SCOPE={
        'url_del':'<?=site_url('main/delUser')?>',
    }
</script>
<?php $this->load->view('template/foot');?>
<?php $this->load->view('template/scrip');?>
<!-- Jquery Validate -->
<script src="<?=base_url("assets/js/Validform_v5.3.2_min.js")?>"></script>
<script src="<?=base_url("assets/js/plugins/dataTables/datatables.min.js")?>"></script>
<script src="<?=base_url("assets/js/dialog.js")?>"></script>
<script src="<?=base_url("assets/js/plugins/iCheck/icheck.min.js")?>"></script>
    <script>
        $(document).ready(function(){
            validform('signupForm');
            $('.i-checks').iCheck({
                checkboxClass: 'icheckbox_square-green',
                radioClass: 'iradio_square-green',
            });
            $('.add_credit').change(function(){
                $('.del_credit').val(0);
            })
            $('.del_credit').change(function(){
                $('.add_credit').val(0);
            })
        })
        $('.attr-edit').on('click',function(){
            var id = $(this).attr('attr-id');
            var f = $('form');
            $.get(SCOPE.url_ajax,{'id':id},function(msg){
                $('#modal-form').modal('show');
                f.find('#openid').val(msg.usr_openid);
                f.find("#nickname").val(msg.usr_nickname);
//                f.find("input[name='usr_phone']").val(msg.usr_phone);
                f.find("input[name='usr_id']").val(msg.usr_id);
                if(msg.ad_id==1){
                    f.find("select[name='ad_status']").parent().parent().remove();
                }
            },'json')
        })

        $('.dataTables-example').DataTable({
            pageLength:10,
            "bFilter": true,
            "bLengthChange":true,
            "ordering":false,
            "dom": '<"top"lf>tr<"buttom"p><"clear">',
            "oLanguage": {
                "sLengthMenu": "_MENU_",
                "sZeroRecords": "抱歉， 没有找到",
                "search": "搜索:",
                "searchPlaceholder": "搜索...",

                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty": "没有数据",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "前一页",
                    "sNext": "后一页",
                    "sLast": "尾页"
                },
            }
        });
    </script>
</body>
</html>
